Skip to content

Fix presigned URL download progress tracking for range requests and add listener tests#6977

Merged
jencymaryjoseph merged 2 commits into
feature/master/pre-signed-url-getobjectfrom
jencyjos/pre-signed-url-getobject/progress-tracking
May 22, 2026
Merged

Fix presigned URL download progress tracking for range requests and add listener tests#6977
jencymaryjoseph merged 2 commits into
feature/master/pre-signed-url-getobjectfrom
jencyjos/pre-signed-url-getobject/progress-tracking

Conversation

@jencymaryjoseph
Copy link
Copy Markdown
Contributor

Motivation and Context

Presigned URL downloads with a user-specified range and multipart enabled produced no progress tracking output. The wrapForNonSerialFileDownload wrapper was applied, but when range is set, multipart is skipped (single request) and split() is never called — so the wrapper's progress hooks never fire.

Modifications

  • GenericS3TransferManager.downloadFileWithPresignedUrl: Added range == null check — uses wrapForNonSerialFileDownload for multipart without range, falls back to wrapResponseTransformer when range is set.
  • GenericS3TransferManager.downloadWithPresignedUrl: Same range == null check.

Testing

  • S3TransferManagerListenerTest: Added TransferListener callback verification tests for presigned URL downloads — verifies transferInitiated, bytesTransferred, transferComplete fire on success, and transferInitiated, transferFailed fire on failure.
  • S3TransferManagerPresignedUrlDownloadIntegrationTest: Added parameterized progress tracking tests (multipart/non-multipart × range/no-range) asserting totalBytes, transferredBytes, and downloaded size correctness.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@jencymaryjoseph jencymaryjoseph requested a review from a team as a code owner May 18, 2026 20:13
}

@Test
public void downloadFileWithPresignedUrl_success_shouldInvokeListener() throws Exception {
Copy link
Copy Markdown
Collaborator

@RanVaknin RanVaknin May 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new tests are using the mock S3CrtAsyncClient which is not a multipart client mock. I think these would pass regardless of the fix?

Are these related to the last PR? Why did we ship these separately?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the integration tests already verify the fix. But since S3TransferManagerListenerTest only uses a mock S3CrtAsyncClient removed the tests in it and created S3TransferManagerPresignedUrlListenerWiremockTest using S3AsyncClient with and without multipartEnabled to verify listener callbacks fire across all code paths.
Shipped separately from #6951 when I identified the range check fix was needed to make the multipart+range test case work correctly.

@jencymaryjoseph jencymaryjoseph requested a review from RanVaknin May 20, 2026 15:50
@jencymaryjoseph jencymaryjoseph merged commit 63d4561 into feature/master/pre-signed-url-getobject May 22, 2026
4 checks passed
@github-actions
Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants